Skip to content

DEV-5629 Support fallback rates in Magento#8

Merged
liammaier merged 8 commits intomasterfrom
DEV-5629-support-fallback-rates
Oct 7, 2025
Merged

DEV-5629 Support fallback rates in Magento#8
liammaier merged 8 commits intomasterfrom
DEV-5629-support-fallback-rates

Conversation

@liammaier
Copy link
Contributor

@liammaier liammaier commented Aug 28, 2025

We don't currently support fallback rates in magento. This adds a setting that will attempt to use the rates defined in magento if shipping lookup fails.

@liammaier liammaier requested a review from a team August 28, 2025 17:19
@liammaier liammaier changed the title Support fallback rates in Magento DEV-5629 Support fallback rates in Magento Aug 28, 2025
Model/Api.php Outdated
Comment on lines +551 to +556
$customerAddress = $customerAddressFactory->create();
$customerAddress->setCountryId($address->getCountryId());
$customerAddress->setRegionId($address->getRegionId());
$customerAddress->setPostcode($address->getPostcode());
$customerAddress->setCity($address->getCity());
$customerAddress->setStreet($address->getStreet());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's an "improvement", but would it make sense to have a setFromAddress method that does all this internally?

Liam Maier added 6 commits September 12, 2025 15:47
- Add _isFallbackToMagentoEnabled() method to check configuration
- Add setFromAddress() helper method for customer address handling
- Update FallbackToMagentoTest.php with comprehensive test coverage
- Support fallback to Magento tax calculation when TaxCloud fails
- Fix undefined property error: change _client to client in Api.php
- Fix multi-line function call formatting in processAndApplyCartItemResponses
- Fix line length warnings by breaking long lines across multiple lines
- Improve code readability with proper PSR-2 formatting
@liammaier liammaier merged commit 642a2ff into master Oct 7, 2025
13 checks passed
@liammaier liammaier deleted the DEV-5629-support-fallback-rates branch October 7, 2025 22:48
try {
// Use reflection to check if the required constants exist
$reflection = new \ReflectionClass(Api::class);
$constants = $reflection->getConstants();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool how ReflectionClass has a built-in getConstants() method. I’m used to just writing getters/setters, but this seems much more flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants